<!DOCTYPE html>
<html lang="cn" window-frame="solid-with-shadow" window-icon="./images/icon/icon.ico">
<head>
    <meta charset="UTF-8">
    <title>BS Redis Desktop Client</title>
    <link rel="stylesheet" href="css/icon.css">
    <style>
        * {
            margin: 0;
            padding: 0
        }

        html, body {
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        .menu {
            width: 100%;
            height: 35px;
            font-size: 12px;
            cursor: pointer;
            border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        }

        .menu:hover {
            background: rgba(0, 0, 0, 0.1);
        }

        .icon {
            width: 35px;
            height: 35px;
            text-align: center;
            line-height: 35px;
            float: left;
        }

        .desc {
            float: left;
            width: calc(100% - 35px);
            line-height: 35px;
        }
    </style>
</head>
<body>

<div class="menu" id="main">
    <div class="icon">
        <i class="icon icon-home-outline"></i>
    </div>
    <div class="desc">主页面</div>
</div>
<div class="menu" id="set">
    <div class="icon">
        <i class="icon icon-settings"></i>
    </div>
    <div class="desc">设置</div>
</div>
<div class="menu" id="exit" role="window-close">
    <div class="icon">
        <i class="icon icon-power"></i>
    </div>
    <div class="desc">退出</div>
</div>
<div class="menu" id="cancel">
    <div class="icon">
        <i class="icon icon-close"></i>
    </div>
    <div class="desc">取消</div>
</div>

<script type="module">
    import tools from "js/tools"

    tools.setTopmost()

    document.on("click", "#exit", () => document.post(new Event("exit", {bubbles: true})))
    document.on("click", "#cancel", () => {
        tools.getView().close()
    })
    document.on("click", "#main", () => {
        document.post(new Event("show-main", {bubbles: true}))
        setTimeout(() => {
            tools.getView().close()
        })
    })
</script>
</body>
</html>